import React, { useEffect, createContext } from 'react';
import Test from './test';
import store from '@/store';

type TObj = {
  a: number,
  b: string
}

export const sub2Content = createContext<TObj>({a: 0, b: 'abc'});

const Sub2: React.FC = (props) => {
  const {spinning, setSpinning} = store
  useEffect(() => {
    setSpinning(false)
  }, []);
  return (
    <div>
      <sub2Content.Provider value={{a: 2, b: 'efg'}}>
        <Test />
      </sub2Content.Provider>
    </div>
  );
};

export default Sub2;
